//
//  RegisterViewController.m
//  环信即时通讯
//
//  Created by 夏阳光 on 16/4/19.
//  Copyright © 2016年 夏阳光. All rights reserved.
//

#import "RegisterViewController.h"
#import <HyphenateFullSDK/EMSDKFull.h>

@interface RegisterViewController ()
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;//用户名
@property (weak, nonatomic) IBOutlet UITextField *password;//密码

@end

@implementation RegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}
- (IBAction)SureAction:(UIButton *)sender {
    
    //注册
    EMError *error = [[EMClient sharedClient] registerWithUsername:self.nameTextField.text password:self.password.text];
    if (error==nil) {
        NSLog(@"注册成功");
        [self dismissViewControllerAnimated:YES completion:^{
            
        }];
        
    }else{
        NSLog(@"注册失败");
    }
}

- (IBAction)cancelAction:(UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}


@end
